<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Button-v-on:click</title>
</head>
<body>
    <div id="app">
        <p v-if="show">这是一段文本</p>
        <button v-on:click="handleClose">点击隐藏</button>
        <button v-on:click="handleShow">点击显示</button>
    </div>
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el:'#app',
            data:()=>{
                return{
                    show:true,
                }
            },
            methods:{
                // 显示
                handleShow: function(){
                    this.show = true
                },
                // 隐藏
                handleClose: function(){
                    this.show = false
                }
            }
        })
    </script>
</body>
</html>